package com.example.mapper;

import com.example.domain.dto.DepartmentDTO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

public interface HospitalDepartmentMapper {

    @Insert("insert into hospital_department(hospital_id, department_id, photopath, detail) VALUES( #{hospitalId},#{departmentId},#{photopath},#{detail})")
    void add(DepartmentDTO departmentDTO);

    @Update("update hospital_department set photopath=#{photopath},detail=#{detail} where hospital_id=#{hospitalId} and department_id=#{departmentId}")
    void update(DepartmentDTO departmentDTO);

    @Delete("delete from hospital_department where hospital_id=#{hospitalId} and department_id=#{departmentId};")
    void del(@Param("hospitalId") Integer hospitalId,@Param("departmentId") Integer departmentId);
}
